3.109 \(\int \frac {(g+h x)^2 (d+e x+f x^2)}{(a+c x^2)^{3/2}} \, dx\)

Optimal. Leaf size=149 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (h^2 (2 c d-3 a f)+2 c g (2 e h+f g)\right )}{2 c^{5/2}}-\frac {h \sqrt {a+c x^2} (4 (c d g-a (e h+2 f g))+h x (2 c d-3 a f))}{2 a c^2}-\frac {(g+h x)^2 (a e-x (c d-a f))}{a c \sqrt {a+c x^2}} \]

[Out]

1/2*((-3*a*f+2*c*d)*h^2+2*c*g*(2*e*h+f*g))*arctanh(x*c^(1/2)/(c*x^2+a)^(1/2))/c^(5/2)-(a*e-(-a*f+c*d)*x)*(h*x+
g)^2/a/c/(c*x^2+a)^(1/2)-1/2*h*(4*c*d*g-4*a*(e*h+2*f*g)+(-3*a*f+2*c*d)*h*x)*(c*x^2+a)^(1/2)/a/c^2

________________________________________________________________________________________

Rubi [A]  time = 0.18, antiderivative size = 149, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {1645, 780, 217, 206} \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (h^2 (2 c d-3 a f)+2 c g (2 e h+f g)\right )}{2 c^{5/2}}-\frac {h \sqrt {a+c x^2} (4 (c d g-a (e h+2 f g))+h x (2 c d-3 a f))}{2 a c^2}-\frac {(g+h x)^2 (a e-x (c d-a f))}{a c \sqrt {a+c x^2}} \]

Antiderivative was successfully verified.

[In]

Int[((g + h*x)^2*(d + e*x + f*x^2))/(a + c*x^2)^(3/2),x]

[Out]

-(((a*e - (c*d - a*f)*x)*(g + h*x)^2)/(a*c*Sqrt[a + c*x^2])) - (h*(4*(c*d*g - a*(2*f*g + e*h)) + (2*c*d - 3*a*
f)*h*x)*Sqrt[a + c*x^2])/(2*a*c^2) + (((2*c*d - 3*a*f)*h^2 + 2*c*g*(f*g + 2*e*h))*ArcTanh[(Sqrt[c]*x)/Sqrt[a +
 c*x^2]])/(2*c^(5/2))

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 780

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(((e*f + d*g)*(2*p
 + 3) + 2*e*g*(p + 1)*x)*(a + c*x^2)^(p + 1))/(2*c*(p + 1)*(2*p + 3)), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 1645

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq,
a + c*x^2, x], f = Coeff[PolynomialRemainder[Pq, a + c*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + c
*x^2, x], x, 1]}, Simp[((d + e*x)^m*(a + c*x^2)^(p + 1)*(a*g - c*f*x))/(2*a*c*(p + 1)), x] + Dist[1/(2*a*c*(p
+ 1)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^(p + 1)*ExpandToSum[2*a*c*(p + 1)*(d + e*x)*Q - a*e*g*m + c*d*f*(2*p
+ 3) + c*e*f*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, c, d, e}, x] && PolyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] &
& LtQ[p, -1] && GtQ[m, 0] &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))

Rubi steps

\begin {align*} \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\left (a+c x^2\right )^{3/2}} \, dx &=-\frac {(a e-(c d-a f) x) (g+h x)^2}{a c \sqrt {a+c x^2}}-\frac {\int \frac {(g+h x) (-a (f g+2 e h)+(2 c d-3 a f) h x)}{\sqrt {a+c x^2}} \, dx}{a c}\\ &=-\frac {(a e-(c d-a f) x) (g+h x)^2}{a c \sqrt {a+c x^2}}-\frac {h (4 (c d g-a (2 f g+e h))+(2 c d-3 a f) h x) \sqrt {a+c x^2}}{2 a c^2}+\frac {\left ((2 c d-3 a f) h^2+2 c g (f g+2 e h)\right ) \int \frac {1}{\sqrt {a+c x^2}} \, dx}{2 c^2}\\ &=-\frac {(a e-(c d-a f) x) (g+h x)^2}{a c \sqrt {a+c x^2}}-\frac {h (4 (c d g-a (2 f g+e h))+(2 c d-3 a f) h x) \sqrt {a+c x^2}}{2 a c^2}+\frac {\left ((2 c d-3 a f) h^2+2 c g (f g+2 e h)\right ) \operatorname {Subst}\left (\int \frac {1}{1-c x^2} \, dx,x,\frac {x}{\sqrt {a+c x^2}}\right )}{2 c^2}\\ &=-\frac {(a e-(c d-a f) x) (g+h x)^2}{a c \sqrt {a+c x^2}}-\frac {h (4 (c d g-a (2 f g+e h))+(2 c d-3 a f) h x) \sqrt {a+c x^2}}{2 a c^2}+\frac {\left ((2 c d-3 a f) h^2+2 c g (f g+2 e h)\right ) \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{2 c^{5/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.28, size = 177, normalized size = 1.19 \[ \frac {\sqrt {c} \left (a^2 h (4 e h+8 f g+3 f h x)+a c \left (-2 d h (2 g+h x)-2 e \left (g^2+2 g h x-h^2 x^2\right )+f x \left (-2 g^2+4 g h x+h^2 x^2\right )\right )+2 c^2 d g^2 x\right )-a^{3/2} \sqrt {\frac {c x^2}{a}+1} \sinh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) \left (3 a f h^2-2 c \left (h (d h+2 e g)+f g^2\right )\right )}{2 a c^{5/2} \sqrt {a+c x^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[((g + h*x)^2*(d + e*x + f*x^2))/(a + c*x^2)^(3/2),x]

[Out]

(Sqrt[c]*(2*c^2*d*g^2*x + a^2*h*(8*f*g + 4*e*h + 3*f*h*x) + a*c*(-2*d*h*(2*g + h*x) - 2*e*(g^2 + 2*g*h*x - h^2
*x^2) + f*x*(-2*g^2 + 4*g*h*x + h^2*x^2))) - a^(3/2)*(3*a*f*h^2 - 2*c*(f*g^2 + h*(2*e*g + d*h)))*Sqrt[1 + (c*x
^2)/a]*ArcSinh[(Sqrt[c]*x)/Sqrt[a]])/(2*a*c^(5/2)*Sqrt[a + c*x^2])

________________________________________________________________________________________

fricas [A]  time = 0.89, size = 530, normalized size = 3.56 \[ \left [-\frac {{\left (2 \, a^{2} c f g^{2} + 4 \, a^{2} c e g h + {\left (2 \, a^{2} c d - 3 \, a^{3} f\right )} h^{2} + {\left (2 \, a c^{2} f g^{2} + 4 \, a c^{2} e g h + {\left (2 \, a c^{2} d - 3 \, a^{2} c f\right )} h^{2}\right )} x^{2}\right )} \sqrt {c} \log \left (-2 \, c x^{2} + 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) - 2 \, {\left (a c^{2} f h^{2} x^{3} - 2 \, a c^{2} e g^{2} + 4 \, a^{2} c e h^{2} - 4 \, {\left (a c^{2} d - 2 \, a^{2} c f\right )} g h + 2 \, {\left (2 \, a c^{2} f g h + a c^{2} e h^{2}\right )} x^{2} - {\left (4 \, a c^{2} e g h - 2 \, {\left (c^{3} d - a c^{2} f\right )} g^{2} + {\left (2 \, a c^{2} d - 3 \, a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{4 \, {\left (a c^{4} x^{2} + a^{2} c^{3}\right )}}, -\frac {{\left (2 \, a^{2} c f g^{2} + 4 \, a^{2} c e g h + {\left (2 \, a^{2} c d - 3 \, a^{3} f\right )} h^{2} + {\left (2 \, a c^{2} f g^{2} + 4 \, a c^{2} e g h + {\left (2 \, a c^{2} d - 3 \, a^{2} c f\right )} h^{2}\right )} x^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) - {\left (a c^{2} f h^{2} x^{3} - 2 \, a c^{2} e g^{2} + 4 \, a^{2} c e h^{2} - 4 \, {\left (a c^{2} d - 2 \, a^{2} c f\right )} g h + 2 \, {\left (2 \, a c^{2} f g h + a c^{2} e h^{2}\right )} x^{2} - {\left (4 \, a c^{2} e g h - 2 \, {\left (c^{3} d - a c^{2} f\right )} g^{2} + {\left (2 \, a c^{2} d - 3 \, a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{2 \, {\left (a c^{4} x^{2} + a^{2} c^{3}\right )}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(3/2),x, algorithm="fricas")

[Out]

[-1/4*((2*a^2*c*f*g^2 + 4*a^2*c*e*g*h + (2*a^2*c*d - 3*a^3*f)*h^2 + (2*a*c^2*f*g^2 + 4*a*c^2*e*g*h + (2*a*c^2*
d - 3*a^2*c*f)*h^2)*x^2)*sqrt(c)*log(-2*c*x^2 + 2*sqrt(c*x^2 + a)*sqrt(c)*x - a) - 2*(a*c^2*f*h^2*x^3 - 2*a*c^
2*e*g^2 + 4*a^2*c*e*h^2 - 4*(a*c^2*d - 2*a^2*c*f)*g*h + 2*(2*a*c^2*f*g*h + a*c^2*e*h^2)*x^2 - (4*a*c^2*e*g*h -
 2*(c^3*d - a*c^2*f)*g^2 + (2*a*c^2*d - 3*a^2*c*f)*h^2)*x)*sqrt(c*x^2 + a))/(a*c^4*x^2 + a^2*c^3), -1/2*((2*a^
2*c*f*g^2 + 4*a^2*c*e*g*h + (2*a^2*c*d - 3*a^3*f)*h^2 + (2*a*c^2*f*g^2 + 4*a*c^2*e*g*h + (2*a*c^2*d - 3*a^2*c*
f)*h^2)*x^2)*sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2 + a)) - (a*c^2*f*h^2*x^3 - 2*a*c^2*e*g^2 + 4*a^2*c*e*h^2 -
4*(a*c^2*d - 2*a^2*c*f)*g*h + 2*(2*a*c^2*f*g*h + a*c^2*e*h^2)*x^2 - (4*a*c^2*e*g*h - 2*(c^3*d - a*c^2*f)*g^2 +
 (2*a*c^2*d - 3*a^2*c*f)*h^2)*x)*sqrt(c*x^2 + a))/(a*c^4*x^2 + a^2*c^3)]

________________________________________________________________________________________

giac [A]  time = 0.25, size = 219, normalized size = 1.47 \[ \frac {{\left ({\left (\frac {f h^{2} x}{c} + \frac {2 \, {\left (2 \, a c^{3} f g h + a c^{3} h^{2} e\right )}}{a c^{4}}\right )} x + \frac {2 \, c^{4} d g^{2} - 2 \, a c^{3} f g^{2} - 2 \, a c^{3} d h^{2} + 3 \, a^{2} c^{2} f h^{2} - 4 \, a c^{3} g h e}{a c^{4}}\right )} x - \frac {2 \, {\left (2 \, a c^{3} d g h - 4 \, a^{2} c^{2} f g h + a c^{3} g^{2} e - 2 \, a^{2} c^{2} h^{2} e\right )}}{a c^{4}}}{2 \, \sqrt {c x^{2} + a}} - \frac {{\left (2 \, c f g^{2} + 2 \, c d h^{2} - 3 \, a f h^{2} + 4 \, c g h e\right )} \log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + a} \right |}\right )}{2 \, c^{\frac {5}{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(3/2),x, algorithm="giac")

[Out]

1/2*(((f*h^2*x/c + 2*(2*a*c^3*f*g*h + a*c^3*h^2*e)/(a*c^4))*x + (2*c^4*d*g^2 - 2*a*c^3*f*g^2 - 2*a*c^3*d*h^2 +
 3*a^2*c^2*f*h^2 - 4*a*c^3*g*h*e)/(a*c^4))*x - 2*(2*a*c^3*d*g*h - 4*a^2*c^2*f*g*h + a*c^3*g^2*e - 2*a^2*c^2*h^
2*e)/(a*c^4))/sqrt(c*x^2 + a) - 1/2*(2*c*f*g^2 + 2*c*d*h^2 - 3*a*f*h^2 + 4*c*g*h*e)*log(abs(-sqrt(c)*x + sqrt(
c*x^2 + a)))/c^(5/2)

________________________________________________________________________________________

maple [B]  time = 0.01, size = 327, normalized size = 2.19 \[ \frac {f \,h^{2} x^{3}}{2 \sqrt {c \,x^{2}+a}\, c}+\frac {e \,h^{2} x^{2}}{\sqrt {c \,x^{2}+a}\, c}+\frac {2 f g h \,x^{2}}{\sqrt {c \,x^{2}+a}\, c}+\frac {3 a f \,h^{2} x}{2 \sqrt {c \,x^{2}+a}\, c^{2}}+\frac {d \,g^{2} x}{\sqrt {c \,x^{2}+a}\, a}-\frac {d \,h^{2} x}{\sqrt {c \,x^{2}+a}\, c}-\frac {2 e g h x}{\sqrt {c \,x^{2}+a}\, c}-\frac {f \,g^{2} x}{\sqrt {c \,x^{2}+a}\, c}-\frac {3 a f \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{2 c^{\frac {5}{2}}}+\frac {d \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{c^{\frac {3}{2}}}+\frac {2 e g h \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{c^{\frac {3}{2}}}+\frac {f \,g^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{c^{\frac {3}{2}}}+\frac {2 a e \,h^{2}}{\sqrt {c \,x^{2}+a}\, c^{2}}+\frac {4 a f g h}{\sqrt {c \,x^{2}+a}\, c^{2}}-\frac {2 d g h}{\sqrt {c \,x^{2}+a}\, c}-\frac {e \,g^{2}}{\sqrt {c \,x^{2}+a}\, c} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(3/2),x)

[Out]

1/2*h^2*f*x^3/c/(c*x^2+a)^(1/2)+3/2*h^2*f*a/c^2*x/(c*x^2+a)^(1/2)-3/2*h^2*f*a/c^(5/2)*ln(c^(1/2)*x+(c*x^2+a)^(
1/2))+x^2/c/(c*x^2+a)^(1/2)*h^2*e+2*x^2/c/(c*x^2+a)^(1/2)*g*h*f+2*a/c^2/(c*x^2+a)^(1/2)*h^2*e+4*a/c^2/(c*x^2+a
)^(1/2)*g*h*f-x/c/(c*x^2+a)^(1/2)*d*h^2-2*x/c/(c*x^2+a)^(1/2)*e*g*h-x/c/(c*x^2+a)^(1/2)*f*g^2+1/c^(3/2)*ln(c^(
1/2)*x+(c*x^2+a)^(1/2))*d*h^2+2/c^(3/2)*ln(c^(1/2)*x+(c*x^2+a)^(1/2))*e*g*h+1/c^(3/2)*ln(c^(1/2)*x+(c*x^2+a)^(
1/2))*f*g^2-2/c/(c*x^2+a)^(1/2)*g*h*d-1/c/(c*x^2+a)^(1/2)*g^2*e+g^2*d*x/a/(c*x^2+a)^(1/2)

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 227, normalized size = 1.52 \[ \frac {f h^{2} x^{3}}{2 \, \sqrt {c x^{2} + a} c} + \frac {d g^{2} x}{\sqrt {c x^{2} + a} a} + \frac {3 \, a f h^{2} x}{2 \, \sqrt {c x^{2} + a} c^{2}} - \frac {3 \, a f h^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{2 \, c^{\frac {5}{2}}} - \frac {e g^{2}}{\sqrt {c x^{2} + a} c} - \frac {2 \, d g h}{\sqrt {c x^{2} + a} c} + \frac {{\left (2 \, f g h + e h^{2}\right )} x^{2}}{\sqrt {c x^{2} + a} c} - \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} x}{\sqrt {c x^{2} + a} c} + \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{c^{\frac {3}{2}}} + \frac {2 \, {\left (2 \, f g h + e h^{2}\right )} a}{\sqrt {c x^{2} + a} c^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(3/2),x, algorithm="maxima")

[Out]

1/2*f*h^2*x^3/(sqrt(c*x^2 + a)*c) + d*g^2*x/(sqrt(c*x^2 + a)*a) + 3/2*a*f*h^2*x/(sqrt(c*x^2 + a)*c^2) - 3/2*a*
f*h^2*arcsinh(c*x/sqrt(a*c))/c^(5/2) - e*g^2/(sqrt(c*x^2 + a)*c) - 2*d*g*h/(sqrt(c*x^2 + a)*c) + (2*f*g*h + e*
h^2)*x^2/(sqrt(c*x^2 + a)*c) - (f*g^2 + 2*e*g*h + d*h^2)*x/(sqrt(c*x^2 + a)*c) + (f*g^2 + 2*e*g*h + d*h^2)*arc
sinh(c*x/sqrt(a*c))/c^(3/2) + 2*(2*f*g*h + e*h^2)*a/(sqrt(c*x^2 + a)*c^2)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\left (g+h\,x\right )}^2\,\left (f\,x^2+e\,x+d\right )}{{\left (c\,x^2+a\right )}^{3/2}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((g + h*x)^2*(d + e*x + f*x^2))/(a + c*x^2)^(3/2),x)

[Out]

int(((g + h*x)^2*(d + e*x + f*x^2))/(a + c*x^2)^(3/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (g + h x\right )^{2} \left (d + e x + f x^{2}\right )}{\left (a + c x^{2}\right )^{\frac {3}{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)**2*(f*x**2+e*x+d)/(c*x**2+a)**(3/2),x)

[Out]

Integral((g + h*x)**2*(d + e*x + f*x**2)/(a + c*x**2)**(3/2), x)

________________________________________________________________________________________